#ifndef XABSTRACTSYNTAXTREEPARSER_H
#define XABSTRACTSYNTAXTREEPARSER_H
#include <stack>
#include <vector>
#include <xscript/xdefs.h>
#include <xscript/xtoken.h>
#include <xscript/xscriptexecutor.h>
#include <xscript/xnameholder.h>

class XAbstractSyntaxTreeParser : public XNameHolder {
  public:
    virtual ~XAbstractSyntaxTreeParser() = default;
  public:
    virtual XAbstractSyntaxTreePtr parse(const std::vector<XTokenPtr>& tokens) = 0;
  private:
};

class XAbstractSyntaxTreeParserVariable : public XAbstractSyntaxTreeParser {
  public:
    XAbstractSyntaxTreePtr parse(const std::vector<XTokenPtr>& tokens);
  private:
};

class XAbstractSyntaxTreeParserValue : public XAbstractSyntaxTreeParser {
  public:
    XAbstractSyntaxTreePtr parse(const std::vector<XTokenPtr>& tokens);
  public:
    bool isCurrentHighPrority(const std::wstring& top, const std::wstring& current);

  private:
    std::stack<XAbstractSyntaxTreePtr> stack;
    XAbstractSyntaxTreePtr prev;
};

#endif // XABSTRACTSYNTAXTREEPARSER_H
